<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>雪竹分期</title>
		<link rel="stylesheet" href="../css/style.css">
		<link rel="stylesheet" href="../css/common.css">
		<script src="../js/index1.js"></script>
		<script src="../js/rem-config.js"></script>
		<script src="../js/jquery.js"></script>
	</head>
	<body>
		<div class="examine_head">
			<a href="mine.html">
				<img src="../images/x.png" alt="" class="examine_head1">
			</a>
			<span class="examine_head1">雪竹分期</span>
			<img src="../images/caidan.png" alt=""  class="examine_head2">
		</div>
		<div class="xzfq_box">
			<div class="xzfq_content">
				<div class="xzfq_detail">
					<ul>
						<li>
							<p>结款金额</p>
							<a href="javascript:;" class="reg_jine"></a>
						</li>
						<li>
							<p>收款账户</p>
							<a href="javascript:;" class="reg_zh"></a>
						</li>
						<li>
							<p>起止时间<span>*</span></p>
							
							<a href="javascript:;" class="reg_qztime"></a>
						</li>
						<li>
							<p>首次还款日<span>*</span></p>
							
							<a href="javascript:;" class="reg_btime"></a>
						</li>
						<li>
							<p>借款人姓名</p>
							<a href="javascript:;" class="res_name"></a>
						</li>
						<li>
							<p>借款人身份证</p>
							<a href="javascript:;" class="res_idcode"></a>
						</li>
						<li>
							<p>还款日<span>*</span></p>
							<a href="javascript:;" class="reg_hk"></a>
						</li>
						<li>
							<p>借款期限</p>
							<a href="javascript:;" class="res_date"></a>
						</li>
						<li>
							<p>默认还款账户</p>
							<a href="javascript:;" class="res_bank"></a>
						</li>
						<li>
							<p>授权协议</p>
							<a href="javascript:;" class="res_hetong"></a>
						</li>
						<li>
							<p>借款用途</p>
							<a href="javascript:;" class="res_yt"></a>
						</li>
						
						<li id="xzfq_font">
							<span>*</span>预计时间，最终从实际合同时间为准
						</li>
					</ul>
				</div>
				<div class="xzfq_footer">
					<div class="xzfq_footer_left">
						
					</div>
					<div class="xzfq_footer_right">
						<p>本人已仔细阅读并完全理解，接受如下文件，愿意受该文件约束：<span>《个人信用报告查询与上报授权书》</span>、<span>《信息授权函》</span></p>
					</div>
				</div>
				<div class="xzfq_btn">
					<div class="xzfq_btn1" style="color:#f8ba41">返回</div>
					<div class="xzfq_btn2">
						确认申请
					</div>
					
				</div>
			</div>
		</div>	
		<div class="msg"></div>
	</body>
	<script>
		$(function(){
		    //默认查询
            $.ajax({
                url: appPath+"payDivide/findByLoginId",
                data: "",
                contentType: "application/json;charset=utf-8",
                dataType: 'json',//服务器返回json格式数据
                type: 'get',//HTTP请求类型
                success: function (res) {
                    if(res.success) {
                        var _data = res.data;
                        $(".reg_jine").text(_data.amountInstallments);
                        $(".reg_zh").text(_data.paymentAccount);
                        $(".reg_qztime").text(_data.startTime);
                        $(".reg_btime").text(_data.firstPayMentDate);
                        $(".res_name").text(_data.name);
                        $(".res_idcode").text(_data.idCode);
                        $(".reg_hk").text(_data.payMentDate);
                        $(".res_date").text(_data.paymentCycleName);
                        $(".res_date").attr("res_id", _data.paymentCycle);
                        $(".res_bank").text(_data.backBank);
                        $(".res_yt").text(_data.myCourseName);
                        $(".res_yt").attr("res_id", _data.myCourse);
                        $(".res_hetong").text(_data.agreement);
                    }else{
                        $(".msg").show().text("失败！原因"+res.errorMessage);
                        setTimeout(function(){
                            $('.msg').hide('slow')
                        },2000)
                    }
                }, error: function () {

                }
            })

			// 勾变色
			$('.xzfq_footer_left').addClass('bg1')
			$('.xzfq_footer_left').click(function(){
				$(this).toggleClass('bg1').toggleClass('bg2')
			})
			// 点击发送请求
			$('.xzfq_btn2').click(function(){

				$.ajax({
					url:appPath+"payDivide/add",
                    contentType: "application/json;charset=utf-8",
					dataType:'json',//服务器返回json格式数据
					type:'get',//HTTP请求类型
					success:function(res){
						if(res.success){
							$('.msg').show().text('成功！1秒跳转页面')
							setTimeout(function(){
								window.location.href = "success.html"
							},1000)
							
						}else{
							$(".msg").show().text("失败！原因"+res.errorMessage);
							setTimeout(function(){
								$('.msg').hide('slow')
							},2000)
						}
					},
					
				});
			})
			
			
			
			
			
			
		})
		
		
	</script>
</html>
